﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using DuelQuizz.DuelQuizzServiceReference;
using DuelQuizz.Views;

namespace DuelQuizz.contract
{
    [CallbackBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
    public class DuelQuizzService : IDuelQuizzServiceCallback
    {
        private DuplexChannelFactory<IDuelQuizzService> channel;
        public IDuelQuizzService client;


        public DuelQuizzService()
        {
            channel = new DuplexChannelFactory<IDuelQuizzService>(this, "WSDualHttpBinding_IDuelQuizzService");
            client = channel.CreateChannel();

            //client.ServiceConnection();
        }

        #region IDuelQuizzServiceCallback Membres

        public void test()
        {
            MessageBox.Show("Couccou");
           
        }

        public void refreshListParties()
        {
            MainPage.refreshPartyList();
        }

        public void refreshNotifications()
        {
            MainPage.refreshNotification();
        }

        public void startDuel()
        {
            MainPage.startDuel();
        }

        public void duelRequestedBy(int j1, int j2)
        {
            MainPage.duelRequestedBy(j1, j2);
        }

        public void duelRequestedBy(int id)
        {

        }

        #endregion




    }
}
